<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<button id="b" onclick="t1()">
    请点击
</button>
<button onclick="zz()">
 判断质数
</button>
</body>
<script>
    function t1() {
        alert("=====")
    }

    var m=function () {

    }
    function zz() {
        var n = window.prompt("输入一个数字判断是否为质数")
        if (isNaN(n)){

        }else {
            for (let i = 2; i < n; i++) {
                if (n%i==0){
                    alert("不是质数")
                    break;
                }


            }
            alert("是质数")
        }
    }
</script>
</html>